module.exports = {
  outputDir: "../api/src/main/resources/templates",
  indexPath: "index.html",
  publicPath: process.env.NODE_ENV === 'development' ? './' : "/", // index.html 内访问静态资源路径 / 绝对路径
  assetsDir: process.env.NODE_ENV === 'development' ? 'static' : '../static', // 打包跟 templates 同级, 避免 icon 丢失
  lintOnSave: true,
  devServer: {
    overlay: {
      warnings: true,
      errors: true
    },
    open: true,
    host: "localhost",
    port: "8080",
    https: false,
    hotOnly: false,
    proxy: {
      "/api": {
        target: 'http://127.0.0.1:12999/', //目标接口域名
        pathRewrite: {
          "^/api": "/"
        },
        changeOrigin: true
      },
      "/ipApi": {
        target: 'http://pv.sohu.com/', //目标接口域名
        pathRewrite: {
          "^/ipApi": "/"
        },
        changeOrigin: true
      }
    }
  },
  "transpileDependencies": [
    "vuetify"
  ],
  chainWebpack: config =>{
    config.plugin('html')
      .tap(args => {
        args[0].title = '白羊技术博客'
        return args;
      })
  },
}